import { BasicRemoveParams } from './../model/baseModel';
import { defHttp } from '/@/utils/http/axios';
import { DepartmentParams, DepartmentOptionGetResultModel, ListDepartmentParams } from './model/departmentModel';
enum Api{
    LIST_DEPARTMENT = '/department/listDepartment',
    ADD_DEPARTMENT = '/department/addDepartment',
    UPDATE_DEPARTMENT = '/department/updateDepartment',
    REMOVE_DAPARTMENT = '/department/removeDepartment',
    GET_DEPARTMENT_OPTION = '/department/getDepartmentOption',
    UPDATE_STATE = "/department/updateState",
    LIST_HOSPITAL_DEPARTMENT = "/department/listAllHospitalAnd1Department"
}

export const listDepartment = (params:ListDepartmentParams)=>{
    return defHttp.post({url:Api.LIST_DEPARTMENT,params})
}
export const addDepartment = (params:DepartmentParams)=>{
    return defHttp.post({url:Api.ADD_DEPARTMENT,params})
}
export const updateDepartment = (params:DepartmentParams)=>{
    return defHttp.post({url:Api.UPDATE_DEPARTMENT,params})
}
export const removeDepartment = (params:BasicRemoveParams)=>{
    return defHttp.post({url:Api.REMOVE_DAPARTMENT,params})
}
export const getDepartmentOption =(params:string)=>{
    return defHttp.get<DepartmentOptionGetResultModel>({url:Api.GET_DEPARTMENT_OPTION,params})
}
export const updateState = (params)=>{
    return defHttp.post({url:Api.UPDATE_STATE,params})
}

export const listAllHospitalAnd1Department = ()=>{
    return defHttp.get({url:Api.LIST_HOSPITAL_DEPARTMENT})
}